<?php
/**
 * Created by PhpStorm.
 * User: yfl
 * Date: 2021/1/14
 * Time: 0:03
 */

namespace app\printer\controller;

//耗材信息


use think\Db;
use think\facade\Request;

class ConsumableController extends BaseController
{
    //得到耗材型号
    public function get_consumable_type()
    {
        if(Request::isPost()){
            $print_type = Request::post('print_type');
            $map['print_type'] = ['eq', trim($print_type)];
            $consumable_type = Db::name('consumable')->where($map)->field('consumable_type')->select();
            return $consumable_type;
        }
    }
    //得到页数和价格
    public function get_page_price()
    {
        if(Request::isPost()){
            $consumable_type = Request::post('consumable_type');
            $map['consumable_type'] = ['eq', trim($consumable_type)];
            $page_price = Db::name('consumable')->where($map)->field('page_num,price')->find();
            return $page_price;
        }
    }
}